<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
  <base href="<%=basePath%>">
  <meta charset="utf-8">
  <title>点名签到</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <link rel="stylesheet" href="layuiadmin/layui/css/layui.css" media="all">
  <link rel="stylesheet" href="layuiadmin/style/admin.css" media="all">
  <style type="text/css">
	.layui-table-cell .layui-form-checkbox[lay-skin="primary"]{
	     top: 50%;
	     transform: translateY(-50%);
	}
  </style>
</head>
<body>
  <div class="layui-fluid">
    <div class="layui-card">
      <div class="layui-form layui-card-header layuiadmin-card-header-auto">
        <div class="layui-form-item">
          <div class="layui-inline">
            <label class="layui-form-label">点名UUID</label>
            <div class="layui-input-inline">
              <input type="text" name="uuid" placeholder="请输入" autocomplete="off" class="layui-input layui-disabled" readonly = "readonly" value="${rollcallinfo.uuid}">
            </div>
          </div>
          <div class="layui-inline">
            <button class="layui-btn layuiadmin-btn-list" lay-submit lay-filter="LAY-rollcallinfo-contlist-search">
              <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
            </button>
          </div>
        </div>
      </div>
      <div class="layui-card-body">
      	 <div class="layui-row layui-col-space10">
	        <div class="layui-col-md6">
	        	<div class="layui-card">
		            <div class="layui-card-header">未签到人员</div>
		            <div class="layui-card-body">
		              <table id="LAY-rollcallinfo-content-list" lay-filter="LAY-rollcallinfo-content-list"></table> 
		            </div>
		          </div>
	        </div>
	        <div class="layui-col-md6">
	        	<div class="layui-card">
		            <div class="layui-card-header">已签到人员</div>
		            <div class="layui-card-body">
		              <table id="LAY-rollcallinfoed-content-list" lay-filter="LAY-rollcallinfoed-content-list"></table> 
		            </div>
		          </div>
	        </div>
         </div>
      </div>
    </div>
  </div>

  <script src="layuiadmin/layui/layui.js"></script>  
  <script>
  layui.config({
    base: 'layuiadmin/' //静态资源所在路径
  }).extend({
    index: 'lib/index' //主入口模块
  }).use(['index', 'contlist', 'table', 'laydate'], function(){
    var table = layui.table
    ,admin = layui.admin
    ,laydate = layui.laydate
    ,form = layui.form;
    
    table.render({
        elem: '#LAY-rollcallinfo-content-list'
        ,url:'rollcallinfo/findListJson/'
        ,where:{
        	uuid:'${rollcallinfo.uuid}',
        	status: '未签到'
        }
        ,cellMinWidth: 80 //全局定义常规单元格的最小宽度，layui 2.2.1 新增
        ,cols: [[
		  {type:'numbers', title: '序号'}
		  ,{field:'prisonercode', title: '人员编号', sort: true}
          ,{field:'prisonername', title: '人员姓名', sort: true}
        ]]
    	,page: true
   });
    
   table.render({
        elem: '#LAY-rollcallinfoed-content-list'
        ,url:'rollcallinfo/findListJson/'
       	,where:{
       		uuid:'${rollcallinfo.uuid}',
           	status: '已签到'
        }
        ,cellMinWidth: 80 //全局定义常规单元格的最小宽度，layui 2.2.1 新增
        ,cols: [[
		  {type:'numbers', title: '序号'}
		  ,{field:'prisonercode', title: '人员编号', sort: true}
          ,{field:'prisonername', title: '人员姓名', sort: true}
        ]]
    	,page: true
   });
    
    //监听搜索
    form.on('submit(LAY-rollcallinfo-contlist-search)', function(data){
      var field = data.field;
      //执行重载
      table.reload('LAY-rollcallinfo-content-list', {
        where: field
        ,page: {
            curr: 1 //重新从第 1 页开始
        }
      });
      //执行重载
      table.reload('LAY-rollcallinfoed-content-list', {
        where: field
        ,page: {
            curr: 1 //重新从第 1 页开始
        }
      });
    });
    
    //五秒定时刷新一次
    window.reloadView = function () {
    	//执行重载
        table.reload('LAY-rollcallinfo-content-list', {
          page: {
              curr: 1 //重新从第 1 页开始
          }
        });
        //执行重载
        table.reload('LAY-rollcallinfoed-content-list', {
          page: {
              curr: 1 //重新从第 1 页开始
          }
        });
    }

   setInterval('reloadView()',5000); 
    
   
  });
 
  
  </script>
</body>
</html>